
@echo off
rem
rem This scipt is called from PsPAD.
rem The aim is to call "python mkt.py" 
rem with appropriate arguments
rem
echo mktrun from mkt V0.08
rem

rem Try to locate the Python executable, it might not
rem be in the current PATH 
PATH=%PATH%;C:\Python31;C:\Program Files\Python31
PATH=%PATH%;C:\Python30;C:\Program Files\Python30
PATH=%PATH%;C:\Python26;C:\Program Files\Python26
PATH=%PATH%;C:\Python25;C:\Program Files\Python25


rem if called with no arguments: build the application
set CARGS=%1 %2 %3 %4 %5 %6 %7 %8 %9
if x%1==x (
   set CARGS=-build
)   

rem default arguments
set DARGS= -pspad -optimize -sections -noclever -errors

set ARGS=%DARGS% %CARGS%

if "%1" == "-echo" (
   echo %2 %3 %4 %5 %6 %7 %8 %9
   set ARGS=-version -pause
)

rem check for the mkt.py file in this directory and 
rem a few steps higher up in the tree
if exist .\mkt.py (
   python .\mkt.py %ARGS%
   goto done
) 
if exist ..\mkt.py (
   python ..\mkt.py %ARGS%
   goto done
)   
if exist ..\..\mkt.py (
   python ..\..\mkt.py %ARGS%
   goto done
)   
if exist ..\..\..\mkt.py (
   python ..\..\..\mkt.py %ARGS%
   goto done
)   

rem sorry, no mkt.py file found :(
echo "error: no mkt.py file found"

:done
   
